import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import showFLV from '../views/showFLV.vue'
import Main from '../views/Main.vue'

Vue.use(VueRouter)

const routes = [
    //主路由
    {
        path: '/',
        component: Main,
        redirect: '/home',
        children: [
            //子路由
            { path: 'home', component: Home },
            { path: 'flv', component: showFLV },
        ]
    }
]

const router = new VueRouter({
    routes // (缩写) 相当于 routes: routes
})

export default router

